﻿<%@ Page Language="C#" AutoEventWireup="true" Title="Import &raquo; ResourceBlender" CodeFile="Import.aspx.cs" Inherits="Import" MasterPageFile="~/MasterPage.master" %>
<%@ Register TagPrefix="L49" Namespace="Lime49.UI" %>

<asp:Content ID="contentHead" ContentPlaceHolderID="head" runat="server">    
</asp:Content>

<asp:Content ID="contentMain" ContentPlaceHolderID="cntMain" runat="server">
    <asp:ScriptManager ID="scrImport" runat="server">
    </asp:ScriptManager>
    <div class="niceform">
        <h1>Import</h1> 
        <asp:MultiView ID="mltImport" runat="server" ActiveViewIndex="0">
            <asp:View ID="viwNoApps" runat="server">
                <div class="breadcrumbs">
                    <asp:HyperLink ID="lnkNavHome" runat="server" NavigateUrl="~/Default.aspx">ResourceBlender</asp:HyperLink> &gt; Import
                </div>
                <p>You must <asp:HyperLink ID="lnkAddApplication" runat="server" Text="add an application" NavigateUrl="~/Applications.aspx">add an application</asp:HyperLink> before importing resources.</p>
            </asp:View>
            <asp:View ID="viwFiles" runat="server">
                <div class="breadcrumbs">
                    <asp:HyperLink ID="lnkNavFilesHome" runat="server" NavigateUrl="~/Default.aspx">ResourceBlender</asp:HyperLink> &gt; Import
                </div>
                <asp:Label ID="lblFilename" AssociatedControlID="uplXlsFile" runat="server" Text="File name"></asp:Label>
                <asp:FileUpload ID="uplXlsFile" runat="server" />
                <asp:Label ID="lblFiletype" AssociatedControlID="radFiletype" runat="server" Text="File type"></asp:Label>
                <div class="checks">
                    <asp:RadioButtonList ID="radFiletype" runat="server" CssClass="plain autowidth">
                        <asp:ListItem Text="Auto-detect" Value="auto" Selected="True" />
                        <asp:ListItem Text="Java .properties" Value="properties" />
                        <asp:ListItem Text=".NET Managed Resources (.resx)" Value="resx" />
                        <asp:ListItem Text="GNU Portable Object (PO)" Value="po" />
                        <asp:ListItem Text="XML Spreadsheet (exported by ResourceBlender)" Value="xml" />
                    </asp:RadioButtonList>
                </div>
                <asp:Label ID="lblError" runat="server" CssClass="block error"></asp:Label>
                <div class="actions">
                    <asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="Upload" CssClass="uniformbutton btnGo" />
                </div>
            </asp:View>
            <asp:View ID="viwApp" runat="server">
                <div class="breadcrumbs">
                    <asp:HyperLink ID="lnkNavAppHome" runat="server" NavigateUrl="~/Default.aspx">ResourceBlender</asp:HyperLink> &gt; <asp:HyperLink ID="lnkNavAppDone" runat="server" NavigateUrl="~/Import.aspx">Import</asp:HyperLink>  &gt; Choose Application
                </div>
                <asp:UpdatePanel ID="updImport" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Timer ID="tmrImport" runat="server" Enabled="false" Interval="5000" OnTick="tmrImport_Tick">
                        </asp:Timer>
                        <asp:Panel ID="pnlPromptApplication" runat="server">
                            <p><asp:Literal ID="litUploadedInfo" runat="server"></asp:Literal></p>
                            <label class="block">Application</label>
                            <asp:RadioButtonList ID="radApplication" runat="server" RepeatLayout="Flow" 
                                CssClass="checks applicationChecks plain"></asp:RadioButtonList>
                            <div class="clear"></div>
                            <asp:RequiredFieldValidator ID="vldApplication" runat="server" 
                                   ErrorMessage="You must select an application" 
                                   ControlToValidate="radApplication" 
                                   CssClass="error" 
                                   Display="Dynamic" />
                        </asp:Panel>
                        <asp:Literal ID="litProgress" runat="server" Visible="false"><h3>Progress</h3></asp:Literal>
                        <L49:FormattedList ID="lstProgress" runat="server">
                        </L49:FormattedList>
                        <asp:Image ID="imgProgress" runat="server" AlternateText="Importing..." ImageUrl="images/ajax-small.gif" Visible="false" CssClass="block centered" />
                        <asp:Button ID="btnImport" runat="server" Text="Import" OnClick="btnImport_Click" CssClass="uniformbutton btnGo" />
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="tmrImport" EventName="Tick" />
                    </Triggers>
                </asp:UpdatePanel>
            </asp:View>
        </asp:MultiView>
    </div>
</asp:Content>